Skip to content

Docs: add examples for individual_class, server_class and exit_node_class - #294

Open
berkaydiin wants to merge 1 commit into
CiwPython:masterfrom
berkaydiin:docs-custom-class-examples
Open

berkaydiin wants to merge 1 commit into
CiwPython:masterfrom
berkaydiin:docs-custom-class-examples

Conversation

@berkaydiin

Copy link
Copy Markdown

Addresses #286.

The "How to Get More Custom Behaviour" page lists five classes that can be passed into Simulation, but the example library only had examples for node_class and arrival_node_class. This adds one page for each of the other three:

  • Customers With Own Attributes (individual_class): each shopper gets a basket size when they are created, and a custom distribution reads ind.items to set their service time.
  • Servers With Different Speeds (server_class): a Server subclass with a speed attribute. The service distribution divides by ind.server.speed, and the records show the faster server getting through about twice as many customers as the others.
  • Counting Late Orders (exit_node_class): an ExitNode subclass that overrides accept to count orders that spent longer than a target time in a two-node system. The page mentions that exit_date has already been reset by the time an individual reaches the exit node, so the time in the system is read from the data records instead.

On the index page I also fixed three typos ("beahviour", "overwitten", "arugments") and added ciw.ExitNode to the list of parent classes, where it was missing.

The new pages are doctested and pass. Running doctests.py locally, the only failures were results.rst and pause_restart.rst, which need pandas (not installed in my environment) and fail the same way on master. Happy to rename or move the pages if you'd prefer them somewhere else.

🤖 Generated with Claude Code

https://claude.ai/code/session_0148gNqkerECUCfQ6MnLpMnF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant